home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Learn Microsoft Visual Basic 6.0 Now
/
Learn Microsoft Visual Basic 6.0 Now (Microsoft Press)(X03-58607)(1998).ISO
/
media
/
chap02
/
b02d005.cc2
< prev
next >
Wrap
Text File
|
1998-06-07
|
2KB
|
39 lines
0, Okay, in this demonstration I'll create
3, a simple program named Hello World that
5, uses a label object, a text box object,
8, and a command button object to display
10, the test message in the form. First I'll
13, click the Label control in the Visual
14, Basic toolbox and create a label object on
17, my form. The label is used to display
19, text when the program runs. And I'll use
22, the Caption property of the label object
26, to set the text to My Demonstration
27, Program. Next, I'll use a text box object
35, to display a text box on my form. I'll
40, resize and position the text box object
43, with the selection handles. And I'll set
45, the text in the Properties window to
47, Blank, so that I have room for Hello World
49, when I click my command button. I'll
51, create the command button by clicking the
53, CommandButton control in the toolbox, and
56, dragging to create the button. As
58, always, I can resize the button simply and
60, position it with the mouse. I'll go to the
64, Caption property in the Properties
66, window and set the caption to Click Me. Next,
73, I'll write the program code for the
74, Click Me button. I'll open the Code window
78, by double-clicking the button on the
79, form. This displays the event procedure for
82, the Command1 object click event. To
85, display the text, Hello World, in the text
87, box, I'll type the program statement,
90, Text1.Text = "Hello World". When I run the
101, program, the user interface appears on
103, the screen. When I click the Click Me
109, button, the text, Hello World appears in
112, the text box just like I specified in the
114, Code window.
115, END